﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SchoolManagementSystem
{
    public partial class KelasUrut : Form
    {
        public KelasUrut()
        {
            InitializeComponent();
        }

        public string Number
        {
            
            get { return txtNumber.Text; }
        }

        private void KelasUrut_Load(object sender, EventArgs e)
        {

        }

        private void btnOk_Click(object sender, EventArgs e)
        {
           
           
        }

        public int IntValue
        {
            get
            {
                return Int32.Parse(this.txtNumber.Text);
            }
        }

        private void txtNumber_TextChanged(object sender, EventArgs e)
        {
            TextBox txtInput = (TextBox)sender;

            if (txtInput.TextLength != 0)
            {
                for (int i = 0; i < txtInput.TextLength; i++)
                {
                    if (Char.IsDigit(txtInput.Text, i))
                    {
                        // Do not do anything
                    }
                    else
                    {
                        MessageBox.Show("Gunakan angka !", "Peringatan !");
                    }
                }
            }    
        }
    }
}
